﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DDNS.Model.Results
{
    /// <summary>
    /// 查询记录列表返回实体信息
    /// </summary>
    public class RecordListResult
    {
        /// <summary>
        /// 基础返回信息
        /// </summary>
        public BaseResult status { get; set; }
        /// <summary>
        /// 域名信息
        /// </summary>
        public Domain? domain { get; set; }
        /// <summary>
        /// 二级域名信息
        /// </summary>
        public Info? info { get; set; }
        /// <summary>
        /// 记录列表
        /// </summary>
        public List<Records>? records { get; set; }
    }

    /// <summary>
    /// 域名信息
    /// </summary>
    public class Domain
    {
        /// <summary>
        /// 域名ID
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 域名
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 转码之后的域名
        /// </summary>
        public string punycode { get; set; }
        /// <summary>
        ///  域名等级
        /// </summary>
        public string grade { get; set; }
        /// <summary>
        ///  域名所有者
        /// </summary>
        public string owner { get; set; }
        /// <summary>
        ///  
        /// </summary>
        public string ext_status { get; set; }
        /// <summary>
        ///  
        /// </summary>
        public int ttl { get; set; }
        /// <summary>
        ///  
        /// </summary>
        public int min_ttl { get; set; }
        /// <summary>
        ///  DNS 服务器
        /// </summary>
        public string[] dnspod_ns { get; set; }
        /// <summary>
        ///  状态
        /// </summary>
        public string status { get; set; }
        /// <summary>
        ///  
        /// </summary>
        public bool can_handle_at_ns { get; set; }
    }
    /// <summary>
    /// 二级域名信息
    /// </summary>
    public class Info
    {
        /// <summary>
        /// 指定域名下所有记录的总数。
        /// </summary>
        public string sub_domains { get; set; }
        /// <summary>
        /// 指定域名下符合查询条件的记录总数。
        /// </summary>
        public string record_total { get; set; }
        /// <summary>
        /// 返回的 records 列表里的记录数目。
        /// </summary>
        public string records_num { get; set; }
    }
    /// <summary>
    /// 记录信息
    /// </summary>
    public class Records
    {
        /// <summary>
        /// 记录ID编号
        /// </summary>
        public string id { get; set; }
        /// <summary>
        /// 记录的 TTL 值
        /// </summary>
        public string ttl { get; set; }
        /// <summary>
        /// 记录值(IP或域名)
        /// </summary>
        public string value { get; set; }
        /// <summary>
        /// 记录状态：
        /// 0:禁用;
        /// 1:启用
        /// </summary>
        public string enabled { get; set; }
        /// <summary>
        /// 系统内部标识状态, 开发者可忽略
        /// </summary>
        public string status { get; set; }
        /// <summary>
        /// 记录最后更新时间
        /// </summary>
        public string updated_on { get; set; }
        /// <summary>
        /// 子域名(主机记录)
        /// </summary>
        public string name { get; set; }
        /// <summary>
        ///  解析记录的线路
        /// </summary>
        public string line { get; set; }
        /// <summary>
        ///  解析记录的线路ID
        /// </summary>
        public string line_id { get; set; }
        /// <summary>
        ///  记录类型
        /// </summary>
        public string type { get; set; }
        /// <summary>
        ///  记录类型
        /// </summary>
        public string weight { get; set; }
        /// <summary>
        ///  该记录的D监控状态:
        ///  "OK"服务器正常;
        ///  "Warn"该记录有报警, 服务器返回 4XX;
        ///  "Down"服务器宕机;
        ///  ""该记录未开启D监控
        /// </summary>
        public string monitor_status { get; set; }
        /// <summary>
        ///  记录备注
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        ///  是否开通网站安全中心:
        ///  "yes": 已经开启。
        ///  "no": 未开启
        /// </summary>
        public string use_aqb { get; set; }
        /// <summary>
        ///  记录的 MX 记录值, 非 MX 记录类型，默认为 0。
        /// </summary>
        public string mx { get; set; }
    }    

}
